def printTriangle1(nums):
    for row in range(1,nums+1):
        for col in range(nums, 0, -1):
            if col > row:
                print('{:<4s}'.format(' '),end='')
            else:
                print('{:<4d}'.format(col), end='')
        print()


def printTriangle2(nums):
    for row in range(nums,0,-1):
        for col in range(nums, 0, -1):
            if col > row:
                print('{:<4s}'.format(' '),end='')
            else:
                print('{:<4d}'.format(col), end='')
        print()

printTriangle1(15)
print()
printTriangle2(15)

# 空格宽度没有做到统一
